Image reading apparatus, method of controlling image reading apparatus, and storage medium

ABSTRACT

An apparatus corrects a piece of pixel data of a first color of which abnormal pixel is detected in a first color without correcting a piece of pixel data of a second color of which abnormal pixel is not detected in the second color, in the generated pieces of pixel data in a case where the abnormal pixel is a pixel other than a pixel located at an edge portion, and corrects a plurality of pieces of pixel data of all colors at a position where the abnormal pixel is detected in the generated plurality of pieces of pixel data in a case where the detected abnormal pixel is the pixel located at the edge portion.

BACKGROUND OF THE DISCLOSURE Field of the Disclosure

The aspect of the embodiments relates to image reading apparatuses, amethod of controlling an image reading apparatus, and a storage medium.

Description of the Related Art

A copying machine and a multi-function printer include an image readingapparatus for reading images on documents. Among reading methodsemployed by the image reading apparatus, there are two known methods: aplaten reading method in which a document is placed on a platen glassand in which an image on the document is read while the reading unit ismoved, and a scanning method for reading an image on the document whilethe document is conveyed by an auto document feeder (ADF).

In the scan method using the ADF, the position where an image is read isfixed. As a result, if dust particles such as paper dust and dust whichare carried while the document is conveyed are present on a readingposition, streaky abnormal pixels are generated on the read image.

Against this issue, Japanese Patent Application Laid-Open No.2017-204805 discusses a technique in which when dust particles arepresent on a reading position, the dust particles are automaticallydetected and correction processing is performed by image processing.

In the technique discussed in Japanese Patent Application Laid-Open No.2017-204805, an abnormal pixel is detected, and the detected abnormalpixel is corrected by linear interpolation using the vales of pixelsadjacent to the abnormal pixel. If the pixel width of the abnormal pixelis larger than or equal to a predetermined size, correction processingbased on the adjacent pixels is applied to all the colors at theposition of the abnormal pixel, thereby reducing the occurrence ofcoloring due to the correction processing. If the pixel width of theabnormal pixel is smaller than the predetermined size, correctionprocessing based on adjacent pixels is applied to each color for whichdust particles are detected, thereby performing correction processing tomake a correction mark less noticeable.

In the method discussed in Japanese Patent Application Laid-Open No.2017-204805, correction processing based on pixels adjacent to anabnormal pixel with a size less than a predetermined size is performedon each color for which dust particles are detected. If correctionprocessing on a black edge portion is performed by linear interpolationon, for example, the red signal, the signal value of the red signalvaries at the edge portion. Consequently, differences between signalvalues of red, green, and blue signals increase, which causes coloringin the edge portion. The occurrence of a false color results indegradation in image quality and a false determination in auto colorselect (ACS) (determining a black-and-white document to be a colordocument).

SUMMARY OF THE DISCLOSURE

According to an aspect of the embodiments, an apparatus includes areading unit configured to read an image on a document and generate aplurality of pieces of pixel data of a plurality of colors, a detectionunit configured to detect, for each color, an abnormal pixel that is notpresent in the image, a determination unit configured to determinewhether the detected abnormal pixel is a pixel located at an edgeportion, and a correction unit configured to correct a piece of pixeldata of a first color of which the abnormal pixel is detected in thefirst color without correcting a piece of pixel data of a second colorof which the abnormal pixel is not detected in the second color, in thegenerated plurality of pieces of pixel data in a case where thedetermination unit determines the detected abnormal pixel is a pixelother than the pixel located at the edge portion, and to correct aplurality of pieces of pixel data of all colors at a position where theabnormal pixel is detected in the generated plurality of pieces of pixeldata in a case where the determination unit determines the detectedabnormal pixel tis the pixel located at the edge portion.

Further features of the disclosure will become apparent from thefollowing description of exemplary embodiments with reference to theattached drawings.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 illustrates an automatic document feeding apparatus and an imagereading apparatus according to a first exemplary embodiment.

FIG. 2 is a diagram of the configuration of a line sensor according tothe first exemplary embodiment.

FIG. 3 is a block diagram illustrating a control unit according to thefirst exemplary embodiment.

FIG. 4 is a block diagram illustrating an abnormal pixel detection unitaccording to the first exemplary embodiment.

FIG. 5 is a block diagram illustrating an abnormal pixel correction unitaccording to the first exemplary embodiment.

FIG. 6 is a flowchart illustrating a processing procedure of abnormalpixel detection processing according to the first exemplary embodiment.

FIG. 7 is a flowchart illustrating a processing procedure operated by anabnormal pixel correction processing unit according to the firstexemplary embodiment.

FIGS. 8A to 8C each illustrate an example of dust particles present onthe line sensor according to the first exemplary embodiment.

FIGS. 9A and 9B each illustrate an example of correction processingaccording to the first exemplary embodiment.

FIGS. 10A and 10B each illustrate an example of correction processingaccording to the first exemplary embodiment.

FIG. 11 illustrates an example of difference detection processingaccording to the first exemplary embodiment.

FIGS. 12A and 12B each illustrate an example of abnormal pixel flaggeneration processing using differences between signal values accordingto the first exemplary embodiment.

FIGS. 13A and 13B each illustrate an example of correction processingusing differences between signal values according to the first exemplaryembodiment.

FIG. 14 illustrates an example of reference pixel positions for adifference detection unit according to the first exemplary embodiment.

FIG. 15 is a flowchart illustrating a processing procedure executed byan abnormal pixel correction unit according to a second exemplaryembodiment.

FIGS. 16A and 16B each illustrate abnormal pixel flag generationprocessing according to the second exemplary embodiment.

FIGS. 17A and 17B each illustrate an example of correction processingusing differences between signal values according to the secondexemplary embodiment.

FIG. 18 illustrates an example of matching patterns for a determinationprocessing unit according to the second exemplary embodiment.

DESCRIPTION OF THE EMBODIMENTS

Exemplary embodiments of the disclosure will be described in detailbelow with reference to the drawings. The following exemplaryembodiments are not intended to limit the disclosure described in theclaims, and not all combinations of features described in the exemplaryembodiments are used for the solving means of the disclosure.

FIG. 1 illustrates an example of an image reading apparatus suitable forapplying an exemplary embodiment of the disclosure.

The image reading apparatus according to a first exemplary embodimentincorporates an automatic document feeding apparatus 100, which includesa front surface reading unit 121 and a back surface reading unit 122 toread images on both sides of each sheet of the document 102 while theindividual sheets of a document 102 as image reading targets each arebeing conveyed.

A sheet feed roller 103 is connected to a driving source (e.g., a motor)that drives a separation/conveyance roller 104. The rotation of thedriving source turns the sheet feed roller 103 to feed the document 102.The sheet feed roller 103 out of operation is retracted to a homeposition, which is an upper position in FIG. 1, not to hamper documentsetting operation. In response to the start of sheet feeding operation,the sheet feed roller 103 descends and comes into contact with the topsurface of the document 102. The sheet feed roller 103 is rotatablysupported by an arm (not illustrated) that rocks to move the sheet feedroller 103 vertically.

A separation/conveyance driven roller 105 is disposed on the oppositeside of the separation/conveyance roller 104 with theseparation/conveyance driven roller 105 pressed against theseparation/conveyance roller 104. The separation/conveyance drivenroller 105 is formed of rubber or other material that has a slightlyless frictional resistance than that of the separation/conveyance roller104. The separation/conveyance driven roller 105 operates in conjunctionwith the separation/conveyance roller 104 to separate the individualsheets of the documents 102 on a document tray 101 one by one, and eachseparated sheet is fed by the sheet feed roller 103.

Further, the automatic document feeding apparatus 100 includes aregistration roller 106, a registration driven roller 107, a lead roller108, and a lead driven roller 109. The registration roller 106 and theregistration driven roller 107 operate to position leading edges of thefed individual sheets of the document 102 at a separation portion.

The lead roller 108 and the lead driven roller 109 convey each sheet ofthe document 102 toward a scan glass 116. A document detection sensor128 is a sensor that detects the leading edge of each sheet of thedocument 102 being conveyed. A platen roller 110 is disposed over thescan glass 116. After passing over the scan glass 116, which isconfigured to be a first reading unit, each sheet of the document 102 isconveyed to a lead discharge roller 111 and a lead discharge drivenroller 112 by the platen roller 110.

At the end of the scan glass 116 nearer to the lead discharge roller111, a jump base 117 for guiding each sheet of the document 102 upwardis provided to convey the sheets of the document 102 smoothly to thelead discharge roller 111.

Each sheet of the document 102 is conveyed so that one surface of thesheet comes into contact with the scan glass 116. At that time, thefront surface reading unit 121 disposed in an image reading device 115reads an image on the front surface (first surface) of each sheet of thedocument 102 through the scan glass 116. The front surface reading unit121 includes a line sensor. The line sensor includes an R-sensor, aG-sensor, and a B-sensor. The R-sensor detects red light and generatesdigital data. The G-sensor detects green light and generates digitaldata. The B-sensor detects blue light and generates digital data. Theconfiguration of the line sensor will be described in detail below.

The lead discharge roller 111 and the lead discharge driven roller 112convey each sheet of the document 102, which has passed over the scanglass 116, to a scan glass 120. A platen roller 119 in white color isprovided on one side of the scan glass 120. On the other side isprovided the back surface reading unit 122. As with the front surfacereading unit 121, the back surface reading unit 122 includes a linesensor.

With this configuration, an image on the back surface (second surface)of each sheet of the document 102, which has passed through between thescan glass 120 and the platen roller 119, is read by the back surfacereading unit 122. After that, each sheet of the document 102 is conveyedto a discharge roller 113 and is then discharged onto a discharge tray114.

The image reading apparatus with the above-described configuration readsa document in two modes. A first mode is a fixed document reading modein which a document placed on a platen glass 118 is read by the frontsurface reading unit 121 being moved in a sub-scanning direction (thedirection indicated by the arrow in FIG. 1). A second mode is a scanmode in which each sheet of the document 102 is read at the position ofthe scan glass 116 by the automatic document feeding apparatus 100conveying each sheet of the document 102 with the front surface readingunit 121 stopped. The second mode enables not the image on the frontsurface of each sheet of the document 102, but also the image on theback surface of each sheet of the document 102 to be read by using theback surface reading unit 122 in addition to the front surface readingunit 121. FIG. 1 is a diagram illustrating the second mode. Thus, thedocument 102 to be read in the first mode is not illustrated in FIG. 1.

<Configuration of Reading Unit>

FIG. 2 is a diagram illustrating an array structure of light-receivingelements of the line sensor in the front surface reading unit 121. Theback surface reading unit 122 has a structure similar to that of thefront surface reading unit 121, and thus the description thereof isomitted.

A line sensor 201 is, for example, a charge-coupled device (CCD) linearimage sensor. The line sensor 201 includes a plurality oflight-receiving elements disposed, which receive light emitted on andreflected from a sheet of the document 102. One light-receiving elementcorresponds to one pixel, and the width of one light-receiving elementcorresponds to a one-pixel width. For example, a three-pixel width meansthe width of three light-receiving elements. As for pixels in describingimages on the document 102, the image read by a light-receiving elementof one pixel in the line sensor 201 is an image in one pixel (aone-pixel width). The light-receiving elements include a firstlight-receiving element for detecting red light (first color: R), asecond light-receiving element for detecting green light (second color:G), and a third light-receiving element for detecting blue light (thirdcolor: B). Light-receiving elements of R, light-receiving elements of G,and light-receiving elements of B, each of which has a one pixel width,are disposed in order in a predetermined direction at regular intervals.Thus, a light-receiving element column of a repeated pattern of R→G→B isformed in the direction. The line sensor 201 has such a plurality oflight-receiving element columns disposed. A pixel corresponding to alight-receiving element that receives red light is herein referred to asan R-pixel (pixel data representing red). A pixel corresponding to alight-receiving element that receives green light is herein referred toas a G-pixel (pixel data representing green). A pixel corresponding to alight-receiving element that receives blue light is herein referred toas a B-pixel (pixel data representing blue). Each formed of alight-receiving element column in a first direction is referred to as a“line”. One line is formed of one light-receiving element column. Theline sensor 201 has a plurality of lines arranged at predeterminedintervals in a second direction perpendicular to the first direction,each line of which constitutes one light-receiving element column.

The line sensor 201 is configured to read 7500 pixels in themain-scanning direction which is the first direction, and to read threelines in the sub-scanning direction which is the second directionperpendicular to the first direction. The present exemplary embodimentis described assuming that an image is read at a resolution of 600 dotsper inch (dpi) in the main-scanning direction. However, this resolutionis merely an example. The main-scanning direction is a direction inwhich a plurality of light receiving elements is disposed in a row, andis a direction corresponding to a document width direction (thedirection perpendicular to a conveyance direction) while the document isbeing read. The sub-scanning direction is a direction perpendicular tothe main-scanning direction, and is a direction corresponding to thedocument conveyance direction while the document is being read.

The three-line light-receiving element columns are disposed away fromone another at a predetermined pixel width (a predetermined interval) inthe sub-scanning direction, and are arranged such that the color of apixel located at the start end in the cycle of R→G→B is different fromthose of the pixels at their start ends in the other adjacent columns.In the example illustrated in FIG. 2, the interval between linescorresponds to one pixel. As a result, the light-receiving elementcolumn at a line 1 and the light-receiving element column at a line 2are spaced by two pixels in the sub-scanning direction, thelight-receiving element column at the line 1 and the light-receivingelement column at a line 3 are spaced by four pixels in the sub-scanningdirection. In the main-scanning direction, the colors of pixels arearranged in an orderly pattern such as R→G→B→R→G→B→ . . . . As viewedalong the sub-scanning direction, the regular pattern of the line 2 isshifted from that of the line 1 by one pixel in the main-scanningdirection. The regular pattern of the line 3 is shifted from that of theline 1 by two pixels in the main-scanning direction. Thus, thelight-receiving elements for R, G, and B in the line sensor 201 aredisposed in a so-called staggered arrangement. In other words, lightreceiving elements of a color are not arranged in a row across the firstlight receiving element column, the second light receiving elementcolumn, and the third light receiving element column. In reading thedocument 102, the line sensor 201 outputs detection results of signalsfrom individual elements spaced apart from one another by the number ofpixels described above.

The light-receiving elements in the lines 1 to 3 each includelight-transmitting members 202 to 204 each that include an opticalsemiconductor device. Each light-transmitting member has a peaktransmission wavelength that corresponds to the wavelength of lightreceived by the light-transmitting member (the wavelength of red lightfor R). The optical semiconductor devices in the light-transmittingmembers 202 to 204 output signals at a level as a function of anintensity of light transmitted through each of the light-transmittingmembers 202 to 204. Each of the light-transmitting members 202 to 204 isa filter that transmits light of the corresponding color (e.g., redcolor for R). The optical semiconductor devices are, for example,photodiodes. The term “peak transmission wavelength” refers to awavelength at which the transmittance of the filter is maximum. However,if each element can receive light of the corresponding color by itself,the light-transmitting members 202 and 204 are not used.

<Control>

FIG. 3 is a block diagram illustrating the configuration of an imageprocessing apparatus including the automatic document feeding apparatus100 and the image reading device 115 according to the first exemplaryembodiment.

A control unit includes a central processing unit (CPU) 301, ananalog-to-digital (A/D) conversion unit 304, a data sorting unit 305, aline memory 306, a shading correction unit 307, an abnormal pixeldetection unit 308, an abnormal pixel correction unit 309, and a colordetermination unit 310. The control unit is connected to a nonvolatilememory 302, an operation unit 303, the front surface reading unit 121,the back surface reading unit 122, a storage unit 311, a printing unit312, and a network interface (I/F) 313.

The CPU 301 controls operations of the automatic document feedingapparatus 100 and the image reading device 115 by executing controlprograms stored in the nonvolatile memory 302. The nonvolatile memory302 is, for example, a read-only memory (ROM).

The operation unit 303 is a user interface for, for example, setting adouble-sided reading mode for reading both sides of the individualsheets of the document 102, setting a resolution for reading, andsetting a transmission destination of image data representing a readimage. The settings input via the operation unit 303 are transmitted tothe CPU 301 and are stored in the storage unit 311 such as a hard diskdrive (HDD).

The A/D conversion unit 304 converts analog electric signals read by thefront surface reading unit 121 and the back surface reading unit 122into image data which constitutes digital signals.

The data sorting unit 305 rearranges the image data, which is generatedfrom the document 102 that has been read, so that the pixels of a colorare adjacent to one another.

The line memory 306 is a memory that stores the image data that isobtained through the conversion by the A/D conversion unit 304 and isrearranged by the data sorting unit 305.

The shading correction unit 307 performs shading correction processingthat corrects unevenness in light quantity and the effect of differencesin sensitivity between light-receiving elements, on the read datacorresponding to each color of R, G, and B stored in the line memory306. The shading correction processing uses shading coefficientsobtained by reading a white reference plate (not illustrated).

The abnormal pixel detection unit 308 detects an abnormal pixel that isnot present in any image on the sheets of the document 102, based on theresults detected by the light-receiving elements that receive light of acolor in different lines. In the present exemplary embodiment, anabnormal pixel is detected based on the state of the pixels rearrangedby the data sorting unit 305. The abnormal pixel detection unit 308 willbe described in detail below.

The abnormal pixel correction unit 309 performs abnormal pixelcorrection processing based on the image data and abnormal pixelinformation detected by the abnormal pixel detection unit 308. Theabnormal pixel correction unit 309 will be described in detail below.

The color determination unit 310 performs processing for determiningwhether the image data generated by the abnormal pixel correction unit309 indicates a color image or a black-and-white image. For example,input RGB image data is converted into (L, a, b) color space data andthreshold processing is performed to thereby determine whether the imagedata indicates a color image or a black-and-white image. In the (L, a,b) color space, as the values a and b are closer to 0, the color aremore perceived as black and white. The threshold processing is performedon abs (a) or abs (b), and if the value obtained as a result ofthreshold processing is lower than a threshold, it is determined thatthe image data indicates a black-and-white image. The expression “abs ()” represents an absolute value here.

The image data on which the abnormal pixel correction processing isexecuted by the abnormal pixel correction unit 309 and the determinationresult obtained by the color determination unit 310 are stored in thestorage unit 311.

After that, image processing based on the determination result obtainedby the color determination unit 310 is executed on the image data storedin the storage unit 311, and the image data is printed by the printingunit 312. Alternatively, image processing based on the determinationresult obtained by the color determination unit 310 is executed on theimage data stored in the storage unit 311, and the image data istransmitted to a destination designated by the operation unit 303through the network I/F 313.

<Abnormal Pixel Detection Unit>

FIG. 4 is a block diagram illustrating the abnormal pixel detection unit308 according to the first exemplary embodiment.

The abnormal pixel detection unit 308 includes a document detectionsensor 128, an inter-sheet abnormal pixel detection unit 401, a shadowdetection unit 402, and a document leading edge abnormal pixel detectionunit 403.

The inter-sheet abnormal pixel detection unit 401 detects abnormal pixelcandidates based on image data when any surface of a sheet of thedocument 102 is not at a reading position. Specifically, the inter-sheetabnormal pixel detection unit 401 detects abnormal pixel candidates froma result (image data) obtained by the white platen roller 110 being readin an inter-sheet area. An abnormal pixel candidate is a pixel with aluminance value that is lower than or equal to a predetermined luminancevalue (pixels of colors closer to black). The term “inter-sheet area”refers to a gap between a sheet of the document conveyed along aconveyance path and the next sheet of the document subsequentlyconveyed.

Abnormal pixel candidates detected by the inter-sheet abnormal pixeldetection unit 401 probably are caused by, for example, dust particlespresent on the platen roller 110, or dust particles present on the scanglass 116. Dust particles are foreign matter such as paper dust or dust.

The shadow detection unit 402 detects a shadow generated at the leadingedge of a sheet of the document 102 based on input image data to detectthe leading edge of the sheet of the document 102 (the leading edge areaof a sheet of the document). The shadow detection unit 402 outputs adetection result as leading edge information about the sheet of thedocument 102.

The document leading edge abnormal pixel detection unit 403 detectsabnormal pixel candidates based on the information about the leadingedge of the sheet of the document 102 output from the shadow detectionunit 402. Specifically, the document leading edge abnormal pixeldetection unit 403 detects abnormal pixel candidates from the resultobtained by the sheet of the document 102 being read immediately afterthe leading edge of the sheet of the document 102 has passed through thereading position, i.e., the image data on the leading edge area of thedocument 102. For example, typically, image information, such ascharacters or figures, is often provided in the center of a sheet of adocument. As a result, it is difficult to detect abnormal pixelcandidates generated due to dust particles or other foreign matter fromimage data obtained by the area in the center and the surrounding of thecenter of a document being read. In the image reading apparatusaccording to the present exemplary embodiment, abnormal pixel candidatestherefore are detected in the leading edge areas of the individualsheets of the document 102 where a small number of pieces of imageinformation are provided. From the above, abnormal pixel candidatesdetected by the document leading edge abnormal pixel detection unit 403are highly likely to be due to dust particles present on the scan glass116.

FIGS. 8A to 8C each illustrate a case where dust particles are presenton the scan glass 116 over the line sensor illustrated in FIG. 2. Inthis case, main-scanning positions 1 to 9 of the line sensor areillustrated.

FIG. 8A illustrates a case where dust particles are present at themain-scanning positions 4 and 5, which are line sensor positions in theline 2. In FIG. 8A, dust particles are present at B-pixel and R-pixelpositions. FIG. 8B illustrates the result obtained by the pieces ofimage data read in the condition illustrated in FIG. 8A being rearrangedby color by the data sorting unit 305. In the image data read by theline sensor, the width of the abnormal pixels is a two-pixel width. Inthe image data rearranged into the line data of the respective colors,each abnormal pixel has a one-pixel width.

An abnormal pixel width comparison unit 404 determines positions ofabnormal pixels based on a result obtained by abnormal pixel candidatesbeing detected by the inter-sheet abnormal pixel detection unit 401 anda result obtained by abnormal pixel candidates being detected by thedocument leading edge abnormal pixel detection unit 403. The abnormalpixel width comparison unit 404 outputs “1” for an abnormal pixelposition and “0” for a normal pixel position.

An abnormal pixel width determination unit (not illustrated) detects thewidth of an abnormal pixel of each color from the abnormal pixeldetection result output from the abnormal pixel width comparison unit404, and determines whether the detected width exceeds a predeterminedthreshold.

With a detected width of any color beyond the threshold, combiningprocessing is performed on abnormal pixel detection results by color. Inthe combining processing with 1 as a result of abnormal pixel detectionfor any color, “1” is set to all the colors.

FIG. 8C illustrates an abnormal pixel detection result for the dustparticles present as illustrated in FIG. 8A. In FIG. 8C, “1” indicatesan abnormal pixel where a dust particle is present, and “0” indicates anormal pixel where no dust particle is present.

Abnormal pixel correction processing is performed based on the abnormalpixel information detected by the abnormal pixel detection unit 308 andthe image data.

<Flowchart of Abnormal Pixel Detection Processing>

FIG. 6 is a flowchart illustrating an example of a procedure forabnormal pixel detection processing to be performed by the image readingapparatus. The CPU 301 performs processing following this flowchart byrunning a program read from the nonvolatile memory 302.

In step S601, the CPU 301 determines whether a sheet of the document 102has reached the position of the document detection sensor 128 based on asignal from the document detection sensor 128. If it is determined thatthe document 102 has reached the position of the document detectionsensor 128 (YES in step S601), the processing proceeds to step S602.Otherwise, it is determined that the document leading edge is notdetected (NO in step S601), and the processing of step S601 isrepeatedly executed.

In step S602, the CPU 301 starts detection of abnormal pixel candidates(inter-sheet abnormal pixel detection) from image data via theinter-sheet abnormal pixel detection unit 401.

In step S603, the CPU 301 determines whether the detection of abnormalpixel candidates by the inter-sheet abnormal pixel detection unit 401 iscomplete. If it is determined that the detection of abnormal pixelcandidates is complete (YES in step S603), the processing proceeds tostep S604. If not (NO in step S603), the processing of step S603 isrepeatedly executed.

In step S604, the CPU 301 starts shadow detection by the shadowdetection unit 402.

In step S605, the CPU 301 determines whether a shadow is at the leadingedge of the sheet of the document 102 based on the image data. If it isdetermined that a shadow is present (YES in step S605), the processingproceeds to step S606. Otherwise (NO in step S605), the processing ofstep S605 is repeatedly executed.

In step S606, the CPU 301 determines whether a predetermined number oflines have passed through from the line where the shadow is detected. Ifit is determined that the predetermined number of lines have passedthrough (YES in step S606), the processing proceeds to step S607.Otherwise (NO in step S606), the processing of step S606 is repeatedlyexecuted.

In step S607, the CPU 301 starts document leading edge abnormal pixeldetection by the document leading edge abnormal pixel detection unit403. The shadow detection is performed at each main-scanning position. Askewed sheet of the document 102 causes the timing at which the shadowis detected to vary, and the timing when the processing of the documentleading edge abnormal pixel detection 403 is started differs dependingon the main-scanning position.

In step S608, the CPU 301 determines whether the document leading edgeabnormal pixel detection by the document leading edge abnormal pixeldetection 403 is complete. If it is determined that the document leadingedge abnormal pixel detection is complete (YES in step S608), theprocessing proceeds to step S609. Otherwise (NO in step S608), theprocessing of step S608 is repeatedly executed.

In step S609, the CPU 301 starts abnormal pixel width comparison basedon the output result from the inter-sheet abnormal pixel detection unit401 and the output result from the document leading edge abnormal pixeldetection unit 403 via the abnormal pixel width comparison unit 404.

In step S610, the CPU 301 determines whether the abnormal pixel widthcomparison by the abnormal pixel width comparison unit 404 is complete.If it is determined that the abnormal pixel width comparison is complete(YES in step S610), the processing proceeds to step S611. If not (NO instep S610), the processing of step S610 is repeatedly executed.

In step S611, the CPU 301 starts abnormal pixel width determination bycolor with respect to the output result from the abnormal pixel widthcomparison unit 404 via the abnormal pixel width determination unit.

In step S612, the CPU 301 determines whether the abnormal pixel widthdetermination by the abnormal pixel width determination unit iscomplete. If it is determined that the abnormal pixel widthdetermination is complete (YES in step S612), the processing proceeds tostep S613. Otherwise (NO in step S612), the processing of step S612 isrepeatedly executed.

In step S613, the CPU 301 finalizes the abnormal pixel detection result,and then terminates the processing.

Next, the abnormal pixel correction processing will be described.

FIGS. 9A and 9B each illustrate an example of interpolation processingwhen the sheet of the document 102 is read with dust particles presentas illustrated in FIG. 8A, at all the main-scanning positions 1 to 9 ofwhich are all covered with an black image. In this example, abnormalpixel flags are generated for the B-pixel located at the main-scanningposition 4 and the R-pixel located at the main-scanning position 5. Asillustrated in FIG. 9A, normal values of reading signal values at themain-scanning positions are indefinite. The term “indefinite” means apixel for which a reading signal value illustrated in FIG. 9A is notplotted. Linear interpolation processing based on adjacent pixels isperformed on the pixels for which reading signal values are indefinitebased on the abnormal pixel detection result.

FIG. 9B illustrates results obtained by pixel values being calculated bylinear interpolation processing. The adjacent pixels have a luminancevalue of 0, and thus the pixel values calculated by interpolationprocessing also are 0.

FIGS. 10A and 10B each illustrate an example of interpolation processingwhen a sheet of the document 102 is read with dust particles present asillustrated in FIG. 8A, the image on which has pixel values changed fromwhite to black near the main-scanning positions 4 and 5. A portion inthe vicinity of the boundary at which the color changes from white toblack is referred to as an edge portion. Since the abnormal pixel flagsare generated for the B-pixel located at the main-scanning position 4and the R-pixel located at the main-scanning position 5, as illustratedin FIG. 10A, the normal values of reading signal values for the colorsat the respective main-scanning positions are indefinite. Linearinterpolation processing based on adjacent pixels therefore is performedbased on the abnormal pixel detection result. FIG. 10B illustratesresults obtained by pixel values being calculated by linearinterpolation processing. In this case, the B-pixel is detected as anabnormal pixel at the main-scanning position 4, and thus linearinterpolation is performed based on the B-pixels located at themain-scanning positions 3 and 5.

In this case, the B-pixel located at the main-scanning position 3indicates 255 and the B-pixel located at the main-scanning position 5indicates 64. Hence, the linear interpolation processing for the B-pixelresults in (255×1+64×1)/2=160.

At the main-scanning position 5, the R-pixel is detected as an abnormalpixel. Linear interpolation therefore is performed based on the R-pixelslocated at the main-scanning positions 4 and 6.

In this case, the R-pixel located at the main-scanning position 4indicates 192 and the R-pixel located at the main-scanning position 6indicates 0. The linear interpolation processing for the R-pixel resultsin (192×1+0×1)/2=96.

As the results of interpolation processing, pixel values of the R-pixel,the G-pixel, and the B-pixel at the main-scanning position 4 are (192,192, 160), and coloring occurs due to differences between the signalvalues of the R-pixel, the G-pixel, and the B-pixel.

In addition, the pixel values of the R-pixel, the G-pixel, and theB-pixel at the main-scanning position 5 are (96, 64, 64), and coloringoccurs due to differences in the signal values of the R-pixel, theG-pixel, and the B-pixel also at the main-scanning position 5.

Due to the occurrence of coloring through the interpolation processing,the color determination unit 310 may erroneously determine theblack-and-white image sheet of the document 102 to be a color image.

In the present exemplary embodiment, even if an abnormal pixel isgenerated due to a dust particle present at an black edge portion,abnormal pixel correction processing is performed to reduce theoccurrence of coloring.

<Abnormal Pixel Correction Unit>

FIG. 5 is a block diagram illustrating the abnormal pixel correctionunit 309 according to the first exemplary embodiment.

A difference detection unit 501 detects whether there is a differencebetween signal values of pixels in the vicinity of a pixel-of-interestposition by color of input image data. FIG. 14 illustrates an example ofreference pixel positions for which the difference detection unit 501detects whether there is a difference between signal values. Thedifference detection unit 501 sets a window with a predetermined size toreference adjacent pixels. In the present exemplary embodiment, anexample will be illustrated where a window that forms a 7×1 arrangementis set, but the size of the window is not limited to this example.Reference pixel positions (1) illustrated in FIG. 14 are set on bothsides of a pixel of interest. In this case, a difference between asignal value of a pixel L on the left of the pixel-of-interest positionand a signal value of a pixel R on the right of the pixel-of-interestposition is calculated. Specifically, diff=abs (pixel L−pixel R) iscalculated. If the difference value diff exceeds a threshold, it isdetermined that there is a difference between signal values at thepixel-of-interest position. If the difference value diff is lower thanor equal to the threshold, it is determined that there is no differencebetween signal values. As for reference pixel positions (2) andreference pixel positions (3), it is determined whether there is adifference between signal values at different pixel positions. In thepresent exemplary embodiment, although an example is illustrated wherethe three patterns of the reference pixel positions (1), (2), and (3)are set, reference pixel positions are not limited to this example. Thedifference detection unit 501 outputs information indicating whetherthere is a difference between signal values in each pattern of the setreference pixel positions.

A determination processing unit 502 generates a signal value differenceflag for each color based on the difference detection result generatedby the difference detection unit 501 and the abnormal pixel detectionresult generated by the abnormal pixel detection unit 308.

FIG. 18 illustrates patterns for pattern matching in a window forming a7×1 arrangement based on the abnormal pixel detection result for eachcolor generated by the abnormal pixel detection unit 308.

In this case, if the abnormal pixel detection result matches the patternNo. 1 illustrated in FIG. 18, a signal value difference flag generatedby the difference detection unit 501 for the reference pixel positions(1) illustrated in FIG. 14 is output.

If the abnormal pixel detection result matches the pattern No. 2illustrated in FIG. 18, a signal value difference flag generated by thedifference detection unit 501 for the reference pixel positions (2)illustrated in FIG. 14 is output.

If the abnormal pixel detection result matches the pattern No. 3illustrated in FIG. 18, a signal value difference flag generated by thedifference detection unit 501 for the reference pixel positions (3)illustrated in FIG. 14 is output.

An inter-color combining unit 503 combines the signal value differenceflags for each color generated by the determination processing unit 502.

In this case, letting diff_R, diff_G, and diff_B be the signal valuedifference flags, respectively, OR processing is performed on the signalvalue difference flags for all the colors.

diff_R=OR (diff_R, diff_G, diff_B)

diff_G=OR (diff_R, diff_G, diff_B)

diff_B=OR (diff_R, diff_G, diff_B)

This is because, if it is determined that there is a difference betweensignal values for at least one color, interpolation processing isperformed on all the colors at the pixel-of-interest position.

<Flowchart of Abnormal Pixel Correction Processing>

FIG. 7 is a flowchart illustrating an example of a procedure forabnormal pixel correction processing performed by the image processingapparatus. The CPU 301 performs processing following this flowchart byrunning a program read in the nonvolatile memory 302.

In step S701, the CPU 301 detects whether there is a difference betweensignal values by color from image data via the difference detection unit501.

FIG. 11 illustrates a case where difference detection processing isperformed using the reference pixel positions (1) to (3) illustrated inFIG. 14 on the B-pixel of the read image illustrated in FIGS. 10A and10B.

In the pattern of the reference pixel positions (1), the differencevalue is abs (255−64)=191.

In the pattern of the reference pixel positions (2), the differencevalue is abs (255−0)=255.

In the pattern of the reference pixel positions (3), the differencevalue is abs (255−64)=191.

In this case, a threshold based on which it is determined that there isa difference between signal values may be set to, for example, 64. Athreshold set here is a value that allows a difference between signalvalues to be detectable, the difference being at least at a level thatcauses an image with a coloring generated by the abnormal pixelcorrection processing to be determined to be a color image. Asillustrated in FIG. 11, the difference values in all the patterns arehigher than 64, thus it being determined that there is a differencebetween signal values (=1).

In step S702, the CPU 301 determines whether the pixel-of-interestposition corresponds to an abnormal pixel position based on the abnormalpixel detection result output from the abnormal pixel detection unit 308via the determination processing unit 502. If it is determined that thepixel-of-interest position corresponds to an abnormal pixel position(YES in step S702), the processing proceeds to step S703. If not (NO instep S702), the correction processing is not performed, and theprocessing therefore is terminated.

In step S703, the CPU 301 determines whether a difference between signalvalues is detected by the difference detection unit 501 via thedetermination processing unit 502. In other words, it is determinedwhether the pixel-of-interest position corresponds to an edge portion ofthe image. If it is determined that there is a difference between signalvalues (the pixel-of-interest position corresponds to an edge portion ofthe image) (YES in step S703), the processing proceeds to step S704. Ifit is determined that there is no difference between signal values (thepixel-of-interest position corresponds to a portion other than an edgeportion of the image) (NO in step S703), the processing proceeds to stepS706.

In step S704, the CPU 301 sets a difference flag to each of the colorsat the pixel-of-interest position via the inter-color combining unit503. In this case, if there is at least one color for which it isdetermined that the pixel-of-interest position corresponds to anabnormal pixel position and for which there is a difference betweensignal values at the pixel-of-interest position, a difference flag isset to each of all the colors (R, G, and B colors) at thepixel-of-interest position.

In step S705, the CPU 301 combines the output result from the abnormalpixel detection unit 308 and the difference flags at thepixel-of-interest position via the interpolation processing unit 504,and generates a final abnormal pixel flag.

In step S706, the CPU 301 performs interpolation processing based on thefinal abnormal pixel flags generated in step S706.

In step S703, if it is determined that there is no difference betweensignal values (the pixel-of-interest position corresponds to a portionother than an edge portion of the image) (NO in step S703), steps S704and S705 are skipped. A difference flag therefore is not set to anycolors at the pixel-of-interest position. As illustrated in FIGS. 8A to8C, an abnormal pixel flag is set to a pixel of a color for which thesignal value is indefinite due to a dust particle, among a plurality ofcolors at the pixel-of-interest position, and an abnormal pixel flag isnot set to any pixel of the other colors. Thus, in step S706,interpolation processing is performed for the corresponding pixel of thecolor in which the signal value is indefinite due to a dust particle,among the plurality of colors at the pixel-of-interest position, notperformed on the pixels corresponding to the other colors.

FIGS. 12A and 12B each illustrate the difference flag generated by thedetermination processing unit 502 and the inter-color combining unit 503and the abnormal pixel flags generated by the interpolation processingunit 504 in the read image illustrated in FIGS. 10A and 10B.

FIG. 12A illustrates a case where the main-scanning pixel position 4 isset as a pixel-of-interest position, and FIG. 12B illustrates a casewhere the main-scanning pixel position 5 is set as a pixel-of-interestposition.

As illustrated in FIG. 12A, the determination processing unit 502outputs the output result “1” indicating that the B-pixel corresponds tothe abnormal pixel position and there is a difference between signalvalues.

The inter-color combining unit 503 performs OR processing on all thecolors, and thus “1” is output for all the colors at thepixel-of-interest position.

The interpolation processing unit 504 combines the output result fromthe abnormal pixel detection unit 308 with the difference flag at thepixel-of-interest position, and generates the final abnormal pixelflags.

FIGS. 13A and 13B each illustrate corrected signal values where theinterpolation processing unit 504 performs interpolation processingbased on the final abnormal pixel flags. FIG. 13A illustratesinterpolation processing where the main-scanning pixel position 4corresponds to a pixel-of-interest position, and interpolationprocessing on R-pixels is performed based on values at the main-scanningpixel positions 3 and 6.

In this case, the R-pixel located at the main-scanning position 3indicates 255 and the R-pixel located at the main-scanning position 6indicates 0. Hence, when linear interpolation processing is performed,the interpolation processing result for the R-pixels is(255×2+0×1)/3=170.

Interpolation processing on G-pixels is performed based on values at themain-scanning pixel positions 3 and 5.

In this case, the G-pixel located at the main-scanning position 3indicates 255 and the G-pixel located at the main-scanning position 5indicates 64. Hence, when linear interpolation processing is performed,the interpolation processing result for the R-pixels is(255×1+64×1)/2=160.

Interpolation processing on B-pixels is performed based on values at themain-scanning pixel positions 3 and 5.

In this case, the B-pixel located at the main-scanning position 3indicates 255 and the B-pixel located at the main-scanning position 5indicates 64. Hence, when linear interpolation processing is performed,the interpolation processing result for the R-pixels is(255×1+64×1)/2=160.

FIG. 13B illustrates interpolation processing where the main-scanningpixel position 5 indicates a pixel-of-interest position. Interpolationprocessing on R-pixels is performed based on values at the main-scanningpixel positions 4 and 6.

In this case, the R-pixel located at the main-scanning position 4indicates 192 and the R-pixel located at the main-scanning position 6indicates 0. Hence, when linear interpolation processing is performed,the interpolation processing result for the R-pixels is(192×1+0×1)/2=96.

Interpolation processing on G-pixels is performed based on values at themain-scanning pixel positions 4 and 6.

In this case, the G-pixel located at the main-scanning position 5indicates 255 and the G-pixel located at the main-scanning position 6indicates 64. Hence, when linear interpolation processing is performed,the interpolation processing result for the R-pixels is(192×1+0×1)/2=96.

Interpolation processing on B-pixels is performed based on values at themain-scanning pixel positions 3 and 6.

In this case, the B-pixel located at the main-scanning position 3indicates 255 and the B-pixel located at the main-scanning position 6indicates 0. Hence, when linear interpolation processing is performed,the interpolation processing result for the R-pixels is(255×1+0×2)/3=85.

As the results of interpolation processing, the pixel values of theR-pixel, the G-pixel, and the B-pixel at the main-scanning position 4are (170, 160, 160). The differences between the signal values of theR-pixel, the G-pixel, and the B-pixel are lower than the pixel values(192, 192, 160) obtained with no interpolation processing performed forany color in response to the determination of the differences betweenthe signal values. This reduces the occurrence of coloring.

In addition, the pixel values of the R-pixel, the G-pixel, and theB-pixel at the main-scanning position 5 are (96, 96, 85). Thedifferences between the signal values of the R-pixel, the G-pixel, andthe B-pixel are lower than the pixel values (96, 64, 64) obtained withno interpolation processing performed for any color in response to thedetermination of the differences between the signal values. This reducesthe occurrence of coloring.

As described above, according to the present exemplary embodiment, it ispossible to provide the image reading apparatus capable of performingcorrection processing with the occurrence of coloring reduced andwithout making a correction mark noticeable, even if an abnormal pixeloccurs due to a dust particle present at a black edge portion.

A second exemplary embodiment will now be described. In the firstexemplary embodiment described above, a method is described thatperforms correction processing for all the colors at a pixel-of-interestposition for differences between signal values of adjacent pixels whenthe pixel-of-interest position corresponds to an abnormal pixelposition.

In the method according to the first exemplary embodiment, correctionprocessing is performed based on whether the pixel-of-interest positioncorresponds to an abnormal pixel position and whether there aredifferences between signal values of adjacent pixels. As a result,positions of adjacent pixels referenced in the correction processingvary from color to color.

In the second exemplary embodiment, a method will be described thatreduces the occurrence of coloring by correction processing at thepositions of the adjacent pixels referenced in the correctionprocessing, the positions of which are common to all the colors, whenthe pixel-of-interest position corresponds to an abnormal pixel positionand there are differences between signal values of adjacent pixels.

FIG. 15 is a flowchart illustrating an example of a procedure forabnormal pixel correction processing performed by the image readingapparatus according to the second exemplary embodiment. The CPU 301performs processing following this flowchart by executing a programstored in the nonvolatile memory 302.

Steps S1501 to S1505 are respectively similar to steps S701 to S705illustrated in FIG. 7, and thus the descriptions thereof are omitted.

In step S1506, the CPU 301 executes combining processing for all thecolors on the abnormal pixel flag generation result generated in stepS1505.

FIG. 16A illustrates the result obtained by inter-color combiningprocessing being performed for all the colors on the abnormal pixel flaggeneration result generated in step S1505 when the main-scanningposition 4 is set as a pixel-of-interest position. As the result ofinter-color combining processing, abnormal pixel flags indicating 1 atthe main-scanning positions 4 and 5 are generated.

In step S1507, the CPU 301 performs interpolation processing using theabnormal pixel flags generated in step S1506.

FIGS. 17A and 17B each illustrate corrected signal values whereinterpolation processing is performed by the interpolation processingunit 504 based on the final abnormal pixel flags. FIG. 17A illustratesinterpolation processing when the main-scanning pixel position 4corresponds to a pixel-of-interest position. Interpolation processing oneach of the R-pixel, the G-pixel, and the B-pixel is performed based onthe main-scanning positions 3 and 6.

In this case, the R-pixel located at the main-scanning position 3indicates 255 and the R-pixel located at the main-scanning position 6indicates 0. Hence, when linear interpolation processing is performed,the interpolation processing result for the R-pixels is(255×2+0×1)/3=170.

The interpolation processing result for each of the G-pixel and theB-pixel also indicates 170.

FIG. 17B illustrates interpolation processing when the main-scanningpixel position 5 corresponds to a pixel-of-interest position.Interpolation processing on each of the R-pixel, the G-pixel, theB-pixel is performed based on values at the main-scanning pixelpositions 3 and 6.

In this case, the R-pixel located at the main-scanning position 3indicates 255 and the R-pixel located at the main-scanning position 6indicates 0. Hence, when linear interpolation processing is performed,the interpolation processing result for the R-pixels is(255×1+0×2)/3=85.

As the result of interpolation processing, the pixel values of theR-pixel, the G-pixel, and the B-pixel at the main-scanning position 4are (170, 170, 170), and the pixel values of the R-pixel, the G-pixel,and the B-pixel at the main-scanning position 5 are (85, 85, 85). Thus,the differences between the signal values of the R-pixel, the G-pixel,and the B-pixel obtained by the interpolation processing is 0, reducingthe occurrence of coloring.

As described above, according to the present exemplary embodiment, it ispossible to provide a mechanism capable of performing correctionprocessing with the occurrence of coloring reduced and without making acorrection mark noticeable, even when an abnormal pixel occurs due to adust particle present at a black edge portion.

In the above-described exemplary embodiments, the examples areillustrated where the front surface reading unit 121 and the backsurface reading unit 122 are configured using CCD sensors. However, theaspect of the embodiments is not limited to these examples. Either thefront surface reading unit 121 or the back surface reading unit 122 maybe configured using a contact image sensor (CIS). Alternatively, boththe front surface reading unit 121 and the back surface reading unit 122may be configured using CISs.

In the above-described exemplary embodiments, the examples areillustrated that determine whether a pixel-of-interest positioncorresponds to an edge portion of an image based on whether a differencebetween signal values is detected by the difference detection unit 501via the determination processing unit 502. However, the aspect of theembodiments is not limited to these examples. For example, it may bedetermined whether a pixel-of-interest position corresponds to an edgeportion of an image by another method using an edge detection filter.

The aspect of the embodiments can also be implemented by processing inwhich a program for implementing one or more functions according to theabove-described exemplary embodiments is supplied to a system orapparatus via a network or storage medium and in which one or moreprocessors in a computer of the system or apparatus read and execute theprogram. Besides, the disclosure can also be implemented by a circuit(e.g., an application specific integrated circuit (ASIC)) forimplementing one or more functions according to the above-describedexemplary embodiments.

OTHER EMBODIMENTS

Embodiment(s) of the disclosure can also be realized by a computer of asystem or apparatus that reads out and executes computer executableinstructions (e.g., one or more programs) recorded on a storage medium(which may also be referred to more fully as a ‘non-transitorycomputer-readable storage medium’) to perform the functions of one ormore of the above-described embodiment(s) and/or that includes one ormore circuits (e.g., application specific integrated circuit (ASIC)) forperforming the functions of one or more of the above-describedembodiment(s), and by a method performed by the computer of the systemor apparatus by, for example, reading out and executing the computerexecutable instructions from the storage medium to perform the functionsof one or more of the above-described embodiment(s) and/or controllingthe one or more circuits to perform the functions of one or more of theabove-described embodiment(s). The computer may comprise one or moreprocessors (e.g., central processing unit (CPU), micro processing unit(MPU)) and may include a network of separate computers or separateprocessors to read out and execute the computer executable instructions.The computer executable instructions may be provided to the computer,for example, from a network or the storage medium. The storage mediummay include, for example, one or more of a hard disk, a random-accessmemory (RAM), a read only memory (ROM), a storage of distributedcomputing systems, an optical disk (such as a compact disc (CD), digitalversatile disc (DVD), or Blu-ray Disc (BD)™), a flash memory device, amemory card, and the like.

While the disclosure has been described with reference to exemplaryembodiments, it is to be understood that the disclosure is not limitedto the disclosed exemplary embodiments. The scope of the followingclaims is to be accorded the broadest interpretation so as to encompassall such modifications and equivalent structures and functions.

This application claims the benefit of Japanese Patent Application No.2020-008775, filed Jan. 22, 2020, which is hereby incorporated byreference herein in its entirety.

What is claimed is:
 1. An apparatus comprising: a reading unitconfigured to read an image on a document and generate a plurality ofpieces of pixel data of a plurality of colors; a detection unitconfigured to detect, for each color, an abnormal pixel that is notpresent in the image; a determination unit configured to determinewhether the detected abnormal pixel is a pixel located at an edgeportion; and a correction unit configured to correct a piece of pixeldata of a first color of which the abnormal pixel is detected in thefirst color without correcting a piece of pixel data of a second colorof which the abnormal pixel is not detected in the second color, in thegenerated pieces of pixel data in a case where the determination unitdetermines the detected abnormal pixel is a pixel other than the pixellocated at the edge portion, and to correct a plurality of pieces ofpixel data of all colors at a position where the abnormal pixel isdetected in the generated plurality of pieces of pixel data in a casewhere the determination unit determines the detected abnormal pixel isthe pixel located at the edge portion.
 2. The apparatus according toclaim 1, wherein the correction unit corrects the piece of pixel data ofthe first color, the abnormal pixel being detected in the first colorbased on a plurality of pieces of pixel data on pixels adjacent to thedetected abnormal pixel.
 3. The apparatus according to claim 1, whereinthe determination unit determines whether the detected abnormal pixel isthe pixel located at the edge portion based on a difference betweenpixel values of a plurality of pixels adjacent to the detected abnormalpixel.
 4. The apparatus according to claim 3, wherein the detectedabnormal pixel is determined to be the pixel located at the edge portionwith the difference between the pixel values of the plurality of pixelsadjacent to the detected abnormal pixel higher than a predeterminedvalue, and wherein the detected abnormal pixel is determined to be apixel other than the pixel located at the edge portion with thedifference between the pixel values of the plurality of pixels adjacentto the detected abnormal pixel lower than or equal to the predeterminedvalue.
 5. The apparatus according to claim 1, wherein the reading unitreads the image on the document using a first light-receiving element, asecond light-receiving element, and a third light-receiving element, andgenerates the plurality of pieces of pixel data of the plurality ofcolors.
 6. The apparatus according to claim 5, wherein the firstlight-receiving element, the second light-receiving element, and thethird light-receiving element are arranged in a staggered manner.
 7. Theapparatus according to claim 5, wherein the first light-receivingelement is an R-sensor, the second light-receiving element is aG-sensor, and the third light-receiving element is a B-sensor.
 8. Theapparatus according to claim 1, further comprising a printing unitconfigured to execute printing based on the generated plurality ofpieces of pixel data of the plurality of colors.
 9. The apparatusaccording to claim 1, further comprising a transmission unit configuredto transmit the generated plurality of pieces of pixel data of theplurality of colors.
 10. A method of controlling an apparatus,comprising: reading an image on a document and generating a plurality ofpieces of pixel data corresponding to a plurality of colors; detecting,for each color, an abnormal pixel that is not present in the image;determining whether the detected abnormal pixel is a pixel located at anedge portion; and correcting a piece of pixel data of a first color ofwhich the abnormal pixel is detected in the first color withoutcorrecting a piece of pixel data of a second color of which the abnormalpixel being not detected in the second color, in the generated pluralityof pieces of pixel data in a case where it is determined that thedetected abnormal pixel is a pixel other than the pixel located at theedge portion, and correcting a plurality of pieces of pixel data of allcolors at a position where the abnormal pixel is detected in thegenerated plurality of pieces of pixel data in a case where it isdetermined that the detected abnormal pixel is determined to be thepixel located at the edge portion.
 11. The method according to claim 10,wherein the correcting corrects the piece of pixel data of the firstcolor, the abnormal pixel being detected in the first color based on aplurality of pieces of pixel data on pixels adjacent to the detectedabnormal pixel.
 12. The method according to claim 10, wherein thedetermining determines whether the detected abnormal pixel is the pixellocated at the edge portion based on a difference between pixel valuesof a plurality of pixels adjacent to the detected abnormal pixel. 13.The method according to claim 10, wherein the reading reads the image onthe document using a first light-receiving element, a secondlight-receiving element, and a third light-receiving element, andgenerates the plurality of pieces of pixel data of the plurality ofcolors.
 14. The method according to claim 10, further comprisingexecuting printing based on the generated plurality of pieces of pixeldata of the plurality of colors.
 15. A non-transitory computer-readablestorage medium storing a program that, when executed by a computer,causes the computer to perform a method of controlling an apparatusincluding a reading unit configured to read an image on a document andgenerate a plurality of pieces of pixel data of a plurality of colors,the method comprising: detecting, for each color, an abnormal pixel thatis not present in the image; determining whether the detected abnormalpixel is a pixel located at an edge portion; and correcting a piece ofpixel data of a first color of which the abnormal pixel being detectedin the first color without correcting a piece of pixel data of a secondcolor of which the abnormal pixel being not detected in the secondcolor, in the generated plurality of pieces of pixel data in a casewhere it is determined that the detected abnormal pixel is a pixel otherthan the pixel located at the edge portion, and correcting a pluralityof pieces of pixel data of all colors at a position where the abnormalpixel is detected in the plurality of pieces of pixel data generated bythe reading unit in a case where it is determined that the detectedabnormal pixel is the pixel located at the edge portion.
 16. Thenon-transitory computer-readable storage medium according to claim 15,wherein the correcting corrects the piece of pixel data of the firstcolor, the abnormal pixel being detected in the first color based on aplurality of pieces of pixel data on pixels adjacent to the detectedabnormal pixel.
 17. The non-transitory computer-readable storage mediumaccording to claim 15, wherein the determining determines whether thedetected abnormal pixel is the pixel located at the edge portion basedon a difference between pixel values of a plurality of pixels adjacentto the detected abnormal pixel.
 18. The non-transitory computer-readablestorage medium according to claim 15, wherein the reading reads theimage on the document using a first light-receiving element, a secondlight-receiving element, and a third light-receiving element, andgenerates the plurality of pieces of pixel data of the plurality ofcolors.
 19. The non-transitory computer-readable storage mediumaccording to claim 15, further comprising executing printing based onthe generated plurality of pieces of pixel data of the plurality ofcolors.